package com.charger.chargingStation.service.impl;

import java.util.List;
import com.charger.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.charger.chargingStation.mapper.ChargingstationMapper;
import com.charger.chargingStation.domain.Chargingstation;
import com.charger.chargingStation.service.IChargingstationService;

/**
 * 充电站点Service业务层处理
 * 
 * @author charger1
 * @date 2024-11-22
 */
@Service
public class ChargingstationServiceImpl implements IChargingstationService 
{
    @Autowired
    private ChargingstationMapper chargingstationMapper;

    /**
     * 查询充电站点
     * 
     * @param chargingstationId 充电站点主键
     * @return 充电站点
     */
    @Override
    public Chargingstation selectChargingstationByChargingstationId(Long chargingstationId)
    {
        return chargingstationMapper.selectChargingstationByChargingstationId(chargingstationId);
    }

    /**
     * 查询充电站点列表
     * 
     * @param chargingstation 充电站点
     * @return 充电站点
     */
    @Override
    public List<Chargingstation> selectChargingstationList(Chargingstation chargingstation)
    {
        return chargingstationMapper.selectChargingstationList(chargingstation);
    }

    /**
     * 新增充电站点
     * 
     * @param chargingstation 充电站点
     * @return 结果
     */
    @Override
    public int insertChargingstation(Chargingstation chargingstation)
    {
        chargingstation.setCreateTime(DateUtils.getNowDate());
        return chargingstationMapper.insertChargingstation(chargingstation);
    }

    /**
     * 修改充电站点
     * 
     * @param chargingstation 充电站点
     * @return 结果
     */
    @Override
    public int updateChargingstation(Chargingstation chargingstation)
    {
        return chargingstationMapper.updateChargingstation(chargingstation);
    }

    /**
     * 批量删除充电站点
     * 
     * @param chargingstationIds 需要删除的充电站点主键
     * @return 结果
     */
    @Override
    public int deleteChargingstationByChargingstationIds(Long[] chargingstationIds)
    {
        return chargingstationMapper.deleteChargingstationByChargingstationIds(chargingstationIds);
    }

    /**
     * 删除充电站点信息
     * 
     * @param chargingstationId 充电站点主键
     * @return 结果
     */
    @Override
    public int deleteChargingstationByChargingstationId(Long chargingstationId)
    {
        return chargingstationMapper.deleteChargingstationByChargingstationId(chargingstationId);
    }

    @Override
    public List<Chargingstation> selectById(Long Id) {
        return chargingstationMapper.selectById(Id);
    }
}
